<div class="with-padding">
    <form action="{:addons_url('Mail://Mail/sendEmail')}" method="post">
        <div class="cf" style="margin-bottom: 10px">
            <a class="btn" href="{:addons_url('Sensitive://Sensitive/addSensitive')}">新 增</a>

            <button class="btn ajax-post" target-form="ids" url="{:addons_url('Sensitive://Sensitive/savestatus',array('status'=>1))}">启 用</button>
            <button class="btn ajax-post" target-form="ids" url="{:addons_url('Sensitive://Sensitive/savestatus',array('status'=>0))}">禁用</button>

            <button class="btn ajax-post" url="{:addons_url('Sensitive://Sensitive/savestatus',array('status'=>-1))}" target-form="ids">删除</button>
            <a class="btn" href="{:addons_url('Sensitive://Sensitive/batch')}">批量增加</a>
            <!-- 高级搜索 -->

        </div>

        <div class=" ">
            <table class="table table-bordered table-striped">
                <thead>
                <tr>
                    <th class="row-selected" style="width: 20px">
                        <input class="checkbox check-all" type="checkbox">
                    </th>
                    <th>ID</th>
                    <volist name="listKey" id="vo">
                        <th >{$vo}</th>
                    </volist>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                            <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>

                            <td>{$vo.title}</td>

                            <td><php>echo $vo['status']==0? '禁用': '启用';</php></td>

                            <td>{$vo.create_time|friendlyDate}</td>


                            <td><a href="{:addons_url('Sensitive://Sensitive/editSensitive',array('id'=>$vo['id']))}">编辑</a>
                                <if condition="$vo.status eq 1">
                                    <a class="confirm ajax-get" href="{:addons_url('Sensitive://Sensitive/forbidden',array('id'=>$vo['id']))}">禁用</a>
                                    <else/>
                                    <a class="confirm ajax-get" href="{:addons_url('Sensitive://Sensitive/off',array('id'=>$vo['id']))}">启用</a>
                                </if>
                                <a class="confirm ajax-get" href="{:addons_url('Sensitive://Sensitive/delSensitive',array('id'=>$vo['id']))}">删除</a>

                            </td>



                        </tr>
                    </volist>
                    <else/>
                    <td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
                </notempty>
                </tbody>
            </table>

        </div>
    </form>

</div>


<block name="script">
    <script type="text/javascript">
        $(function(){
            //搜索功能
            $("#search").click(function(){
                var url = $(this).attr('url');
                var query  = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
                query = query.replace(/^&/g,'');
                if( url.indexOf('?')>0 ){
                    url += '&' + query;
                }else{
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function(e){
                if(e.keyCode === 13){
                    $("#search").click();
                    return false;
                }
            });

        });
    </script>
</block>

